package xyz.xtt.user.api.enums;

public enum UserFundRecordChangeType {
    BUYER_PAID(0, "买方支付"),
    SELLER_INCOME(1, "卖方收入"),
    PLATFORM_INCOME(2, "平台收入"),
    SELLER_WITHDRAW(3, "卖方提现");

    private final int code;
    private final String description;

    UserFundRecordChangeType(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public UserFundRecordChangeType getByCode(int code) {
        for (UserFundRecordChangeType type : values()) {
            if (type.getCode() == code) {
                return type;
            }
        }
        return null;
    }
}
